package com.my.enums;

/**
 * @author bing_  @create 2022/2/7-17:38
 */
public enum ResultEnum {
    // 成功
    SUCCESS(200,"操作成功"),
    // 登录
    DELETE_FAIL(201,"删除失败"),
    DELETE_SUCCESS(202,"删除成功"),
    ADD_FAIL(203,"添加失败"),
    ADD_SUCCESS(204,"添加成功"),
    UPDATE_FAIL(205,"更新失败"),
    UPDATE_SUCCESS(206,"更新成功"),
    NEED_LOGIN(401,"需要登录后操作"),
    NO_OPERATOR_AUTH(403,"无权限操作"),
    SYSTEM_ERROR(500,"出现错误"),
    USERNAME_EXIST(501,"用户名已存在"),
    PHONENUMBER_EXIST(502,"手机号已存在"),
    EMAIL_EXIST(503, "邮箱已存在"),
    REQUIRE_USERNAME(504, "必需填写用户名"),
    LOGIN_ERROR(505,"用户名或密码错误"),
    CONTENT_NOT_NULL(506,"内容不能为空"),
    OUT_TIME(507,"身份过期重新登录"),
    NO_ACCOUNT(508,"账号不存在"),
    ERROR_PASSWORD(509,"密码错误");


    int code;
    String msg;

    ResultEnum(int code, String errorMessage){
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
